@extends('admin.layout.layout')

@section('css')

    <style>

        .myTree{
            width: 200px;
            height: 100vh;
            overflow: auto;
            background-color: whitesmoke;
            position: fixed;
            left: 0;
            top: 0;
        }

        .myIrf{
            width: calc(100% - 200px);
            height: 100vh;
            padding: 0;
            margin: 0;
            border: none;
            margin-left: 200px;
        }

    </style>

@endsection

@section('content')

    <div id="tree" class="demo-tree demo-tree-box myTree" ></div>

    <iframe class="myIrf" id="ifr" src="http://www.baidu.com" ></iframe>
@endsection

@section('js')

    <script>
        lay.use(['tree'], function(){
            var tree = layui.tree
            var data2 = JSON.parse('{!! $records !!}');
            tree.render({
                elem: '#tree'
                ,data: data2
                ,edit: ['add', 'update', 'del'] //操作节点的图标
                ,click: function(obj){
                    console.log(obj.data);
                }
            });

        })

    </script>

@endsection
